package com.woniu.command.outApplyCommand;


import com.woniu.command.Command;
import com.woniu.command.handler.MaterialOutApplyCommandHandler;
import com.woniu.outlet.po.MaterialOutApplyPo;
import com.woniu.util.ApplicationContextHolder;


public class AddMaterialOutApplyCommand implements Command<MaterialOutApplyPo> {
    private MaterialOutApplyCommandHandler handler;

    public AddMaterialOutApplyCommand(){
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(MaterialOutApplyCommandHandler.class);
    }

    @Override
    public void execute(MaterialOutApplyPo materialOutApplyPo) {
        handler.addMaterialOutApply(materialOutApplyPo.getIds(),materialOutApplyPo.getReason(),
                                        materialOutApplyPo.getDecs(),materialOutApplyPo.getCreateWorkerId());
    }
}
